package com.kingombo.jcl5j;


public class LogFactory  {

    public static Log getLog(String name) {
        return getLoggerImpl(name);
    }

    public static Log getLog(Class<?> clazz) {
        return getLoggerImpl(clazz);
    }

    public static Log getLog() {
        String name = new Exception().getStackTrace()[1].getClassName();
        return getLoggerImpl(name);
    }

    private static Log getLoggerImpl(String name) {

        org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(name);
        return new Log(log);

    }

    private static Log getLoggerImpl(Class<?> clazz) {
        System.out.println(clazz.getName());
        org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(clazz);
        return new Log(log);

    }

}
